import 'package:concert_ticket_client/app/modules/application/controllers/application_controller.dart';
import 'package:concert_ticket_client/app/modules/auth/controllers/auth_controller.dart';
import 'package:concert_ticket_client/app/modules/home/controllers/home_controller.dart';
import 'package:concert_ticket_client/app/modules/recommend_ticket/controllers/recommend_ticket_controller.dart';
import 'package:concert_ticket_client/app/modules/ticket_search/views/ticket_search_view.dart';
import 'package:concert_ticket_client/app/modules/user/controllers/user_controller.dart';
import 'package:concert_ticket_client/app_config.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import 'app/routes/app_pages.dart';

//  控制翻转
ioc() {
  Get.put(UserController());
  Get.put(UserController());
  Get.put(HomeController());
  Get.put(AuthController());
  Get.put(ApplicationController());
  Get.put(RecommendTicketController());
  Get.put(TicketSearchView());
}

init() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AppConfig.initSync();
  ioc();
}

void main() async {

  await init();

  runApp(
    GetMaterialApp(
      initialRoute: AppPages.INITIAL,
      getPages: AppPages.routes,
      debugShowCheckedModeBanner: false,
    ),
  );
}
